<%@ page import="com.zhf.service.StudentService" %>
<%@ page import="com.zhf.bean.Student" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: win
  Date: 2020/10/17
  Time: 17:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生信息列表</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body style="padding: 100px">
    <div>
        <h2>学生列表</h2>
        <a href="menu.jsp">
            <button>返回</button>
        </a>
        <div>
            <table class="table table-striped">
                <caption></caption>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>姓名</th>
                    <th>学号</th>
                    <th>性别</th>
                    <th>生日</th>
                    <th>电子邮箱</th>
                    <th>备注</th>
                    <th>所属班级</th>
                </tr>
                </thead>
                <tbody id='mytbody' class="table-striped">
                <!-- 添加的数据就在这 -->
                <%
                    StudentService studentService = new StudentService();
                    List<Student> students = studentService.getStudents();
                    int n=students.size();
                %>
                <%
                    for (int i=0;i<n;i++){
                        Student student = students.get(i);
                %>
                <tr>
                    <td><%= student.getId()%></td>
                    <td><%= student.getName()%></td>
                    <td><%= student.getStudent_id()%></td>
                    <td><%= student.getSex()%></td>
                    <td><%= student.getBirthday()%></td>
                    <td><%= student.getEmail()%></td>
                    <td><%= student.getRemark()%></td>
                    <td><%= student.getStuclass()%></td>
                </tr>
                <%
                    }
                %>
                </tbody>
            </table>
        </div>
    </div>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
</body>
</html>
